From deecd6adc0193e8d10881e366156885f918e150b Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Thu, 6 Apr 2006 15:55:37 +0100 Subject: [PATCH] Saner error handling in iret hypercall (x86/64). Signed-off-by: Keir Fraser --- xen/arch/x86/x86_64/traps.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/x86_64/traps.c b/xen/arch/x86/x86_64/traps.c index ddf7b0aa30..fcc188364b 100644 --- a/xen/arch/x86/x86_64/traps.c +++ b/xen/arch/x86/x86_64/traps.c @@ -186,13 +186,19 @@ unsigned long do_iret(void) if ( unlikely(copy_from_user(&iret_saved, (void *)regs->rsp, sizeof(iret_saved))) ) + { + DPRINTK("Fault while reading IRET context from guest stack\n"); domain_crash_synchronous(); + } /* Returning to user mode? */ if ( (iret_saved.cs & 3) == 3 ) { if ( unlikely(pagetable_get_paddr(v->arch.guest_table_user) == 0) ) - return -EFAULT; + { + DPRINTK("Guest switching to user mode with no user page tables\n"); + domain_crash_synchronous(); + } toggle_guest_mode(v); } -- 2.30.2